package io.renren.modules.alarm.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.renren.modules.alarm.entity.AlarmTacticsEntity;
import io.renren.modules.alarm.entity.AlarmTacticsSensorEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface AlarmTacticsDao {

    IPage<AlarmTacticsEntity> getList(IPage<AlarmTacticsEntity> query, @Param("params") Map<String, Object> params);

    List<AlarmTacticsSensorEntity> getSensorList(Integer tacticsId);

    AlarmTacticsEntity get(@Param("id") Integer id);

    void add(AlarmTacticsEntity alarmTactics);

    void addSensorList(AlarmTacticsSensorEntity alarmTacticsSensor);

    void update(AlarmTacticsEntity alarmTactics);

    void updateSensorList(AlarmTacticsSensorEntity alarmTacticsSensor);

    void delete(Integer id);

    void deleteSensorList(Integer tacticsId);

    void deleteSensor(Integer sensorId);

    //根据报警策略id和传感器id获取报警上下限
    AlarmTacticsSensorEntity getSensor(@Param("tacticsId") Integer tacticsId, @Param("sensorId") Integer sensorId);

    //综合看板获取健康值和舒适度
    AlarmTacticsEntity getHealthOrComfort(String healthOrComfort);

    List<AlarmTacticsEntity> getRunList();
}
